package com.jumper.cwolf.leetcode;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;

import java.util.HashMap;

/**
 * 描述：
 * 1006. 笨阶乘
 * @author cwolf
 * @version 1.0
 * @date 2021/4/1 14:44
 */
public class Code1 {

    public static int[] twoSum(int[] nums, int target) {

        HashMap<Integer,Integer> map = new HashMap(nums.length);
        for(int i=0;i<nums.length;i++){
            Integer num = nums[i];
            Integer diff = target - num;
            if(map.containsKey(diff)){
                return new int[]{i,map.get(diff)};
            }

            map.put(num,i);

        }

        return new int[]{0,0};
    }

    public static void main(String[] args) {
//        System.out.println(Code1.twoSum(new int[]{
//                2,5,5,7
//        },10));

        String date = "2020-10-27";
        DateTime dateTime = DateUtil.parseDate(date);
        for (int i=0;i<8;i++){
            System.out.println(DateUtil.formatDate(dateTime));
            dateTime = DateUtil.offsetDay(dateTime,27);

        }

    }


}
